package com.jianan.mis.service;

import java.util.List;

import com.jianan.mis.data.dao.ViewDao;
import com.jianan.mis.data.domain.View;

public class ViewServiceImpl implements ViewService {

	private ViewDao viewDao;

	public List<View> getAll() {
		return viewDao.getAll(View.class, "id", true);
	}

	public void remove(View view) {
		view.setGroups(null);
		viewDao.remove(view);
	}

	public void save(View view) {
		viewDao.save(view);
	}

	public void update(View view) {
		viewDao.saveOrUpdate(view);
	}

	public void setViewDao(ViewDao viewDao) {
		this.viewDao = viewDao;
	}

}
